#include<stdio.h>
void main()
{
	int num,topnum,elnum,result[100000]={0},remMed;
	while(scanf("%d",&num)!=EOF)
	{
		int result[100000]={0};
		remMed=0;
		result[0]=1;
		for (int i=1;i<=num;i++)
		{
			for (int j=0;j<=remMed;j++)
			{
				result[j] *= i;
				if (j>0 && result[j-1]>10000)
				{
					result[j] += result[j-1]/10000;
					result[j-1] = result[j-1]%10000;
				}
				if (result[remMed]>=10000)
				{
					remMed++;
				}
				
			}
		}
		printf ("%d",result[remMed]);
		for (int i=remMed-1;i>=0;i--)
		{
			printf ("%04d",result[i]);
		}
		printf ("\n");
	}			
}